package org.jeecg.common.util.p000a;

import com.alibaba.fastjson.JSONObject;

import lombok.Data;

import java.io.Serializable;
import java.util.List;
import java.util.Map;
import org.jeecg.common.system.vo.DictModel;
import org.jeecg.modules.online.cgform.utils.CgformUtil;

/* renamed from: org.jeecg.common.util.a.b */
/* loaded from: hibernate-re-3.7.1-RC.jar:org/jeecg/common/util/a/b.class */
@Data
public abstract class CommonProperty implements Serializable {

    /* renamed from: m */
    private static final long f38m = -426159949502493187L;

    /* renamed from: a f39a */
    protected String key;

    /* renamed from: b f40b*/
    protected String type;

    /* renamed from: c f41c*/
    protected List<DictModel> include;

    /* renamed from: d f42d*/
    protected Object constant;

    /* renamed from: n f43n*/
    private String pattern;

    /* renamed from: o f44o*/
    private String errorInfo;

    /* renamed from: e f45e*/
    protected String view;

    /* renamed from: f f46f*/
    protected String title;

    /* renamed from: g f47g*/
    protected Integer order;

    /* renamed from: h f48h*/
    protected boolean disabled;

    /* renamed from: i f49i*/
    protected String defVal;

    /* renamed from: j f50j*/
    protected String fieldExtendJson;

    /* renamed from: k f51k*/
    protected Integer dbPointLength;

    /* renamed from: l f52l*/
    protected String mode;

    public abstract Map<String, Object> getPropertyJson();

    public JSONObject getCommonJson() {
        JSONObject jSONObject = new JSONObject();
        jSONObject.put("type", this.type);
        if (this.include != null && this.include.size() > 0) {
            jSONObject.put("enum", this.include);
        }
        if (this.constant != null) {
            jSONObject.put("const", this.constant);
        }
        if (this.title != null) {
            jSONObject.put(CgformUtil.f298aR, this.title);
        }
        if (this.order != null) {
            jSONObject.put("order", this.order);
        }
        if (this.view == null) {
            jSONObject.put(CgformUtil.view, "input");
        } else {
            jSONObject.put(CgformUtil.view, this.view);
        }
        if (this.disabled) {
            jSONObject.put("ui", JSONObject.parseObject("{\"widgetattrs\":{\"disabled\":true}}"));
        }
        if (this.defVal != null && this.defVal.length() > 0) {
            jSONObject.put("defVal", this.defVal);
        }
        if (this.fieldExtendJson != null) {
            jSONObject.put("fieldExtendJson", this.fieldExtendJson);
        }
        if (this.dbPointLength != null) {
            jSONObject.put("dbPointLength", this.dbPointLength);
        }
        if (this.mode != null) {
            jSONObject.put("mode", this.mode);
        }
        if (this.pattern != null) {
            jSONObject.put("pattern", this.pattern);
        }
        if (this.errorInfo != null) {
            jSONObject.put("errorInfo", this.errorInfo);
        }
        return jSONObject;
    }
}
